using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace aichat.Entities
{
    [Table("payment_records")]
    public class PaymentRecord
    {
        [Key]
        public int Id { get; set; }
        
        public int UserId { get; set; }
        public virtual UserModel User { get; set; } = null!;
        
        [Required]
        [MaxLength(100)]
        public string OrderId { get; set; } = string.Empty;
        
        [Required]
        [MaxLength(50)]
        public string PaymentMethod { get; set; } = string.Empty; // Alipay, WeChat, etc.
        
        public decimal Amount { get; set; }
        
        public VipType VipType { get; set; }
        
        public PaymentStatus Status { get; set; } = PaymentStatus.Pending;
        
        public DateTime CreatedAt { get; set; } = DateTime.Now;
        
        public DateTime? PaidAt { get; set; }
        
        [MaxLength(500)]
        public string? TransactionId { get; set; }
        
        [MaxLength(1000)]
        public string? Description { get; set; }
    }
    
    public enum PaymentStatus
    {
        Pending = 0,
        Paid = 1,
        Failed = 2,
        Cancelled = 3
    }
} 